<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
   
    <script>
        for(var i = 1;i <= 9;i++){
            for(var j = 1;j<=i;j++){
                document.write(j+"x"+i+"="+i*j+"&nbsp;&nbsp;");
            }
            document.write("<br>");
        }
        //---------------
        document.write("<br>");
        for(var i = 9;i >= 1;i--){
            for(var j = 1;j<=i;j++){
                document.write(j+"x"+i+"="+i*j+"&nbsp;&nbsp;");
            }
            document.write("<br>");
        }
        //---------------
        document.write("<br>");
        for(var i = 1;i <= 9;i++){
            // for(var k = 1;k <= 9;k--){
            //     document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
            // }
            for(var j = 1;j<=i;j++){                
                document.write(j+"x"+i+"="+i*j+"&nbsp;&nbsp;");
            }
            document.write("<br>");
        
        }
        // document.write("<br>");
        // for(var i = 9;i >= 1;i--){
        //     for(var j = 1;j<=i;j++){
        //         document.write(j+"x"+i+"="+i*j+"&nbsp;&nbsp;");
        //     }
        //     document.write("<br>");
        // }
    </script>
</body>
</html>